﻿using System.Data.Entity.ModelConfiguration;

namespace MP.Data.Models.Models.Mapping
{
    public class MeasureAmountMap : EntityTypeConfiguration<MeasureAmount>
    {
        public MeasureAmountMap()
        {
            this.HasKey(t => t.Id);

            this.Property(t => t.Amount)
                .IsRequired();

            this.Property(t => t.MeasureId)
                .IsRequired();

            // Table & Column Mappings
            this.ToTable("MeasureAmount", "Prices");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.MeasureId).HasColumnName("MeasureId");
        }
    }
}
